print "Loading cdb file $file...";
try {
$fileHandle = CdbReader::open( $file );
- } catch ( CdbException $e ) {}
+ } catch ( CdbException $e ) {
+ }
if ( !$fileHandle ) {
print "not a cdb file or unable to read it\n";
}
if ( $stat['size'] != $row->img_size ) {
- $this->output( "{$row->img_name}: size mismatch DB={$row->img_size}, actual={$stat['size']}\n" );
+ $this->output( "{$row->img_name}: size mismatch DB={$row->img_size}, "
+ . "actual={$stat['size']}\n" );
continue;
}
public function __construct() {
parent::__construct();
- $this->mDescription = 'Checks LESS files for errors by running the LessTestSuite PHPUnit test suite';
+ $this->mDescription =
+ 'Checks LESS files for errors by running the LessTestSuite PHPUnit test suite';
}
public function execute() {
parent::__construct();
$this->mDescription = "Check syntax for all PHP files in MediaWiki";
$this->addOption( 'with-extensions', 'Also recurse the extensions folder' );
- $this->addOption( 'path', 'Specific path (file or directory) to check, either with absolute path or relative to the root of this MediaWiki installation',
- false, true );
- $this->addOption( 'list-file', 'Text file containing list of files or directories to check', false, true );
- $this->addOption( 'modified', 'Check only files that were modified (requires Git command-line client)' );
+ $this->addOption(
+ 'path',
+ 'Specific path (file or directory) to check, either with absolute path or '
+ . 'relative to the root of this MediaWiki installation',
+ false,
+ true
+ );
+ $this->addOption(
+ 'list-file',
+ 'Text file containing list of files or directories to check',
+ false,
+ true
+ );
+ $this->addOption(
+ 'modified',
+ 'Check only files that were modified (requires Git command-line client)'
+ );
$this->addOption( 'syntax-only', 'Check for syntax validity only, skip code style warnings' );
}
$this->buildFileList();
// ParseKit is broken on PHP 5.3+, disabled until this is fixed
- $useParseKit = function_exists( 'parsekit_compile_file' ) && version_compare( PHP_VERSION, '5.3', '<' );
+ $useParseKit = function_exists( 'parsekit_compile_file' )
+ && version_compare( PHP_VERSION, '5.3', '<' );
$str = 'Checking syntax (using ' . ( $useParseKit ?
'parsekit' : ' php -l, this can take a long time' ) . ")\n";
public function execute() {
if ( !$this->hasOption( 'force' ) ) {
$this->error( "This maintenance script will remove old columns and indexes.\n"
- . "It is recommended to backup your database first, and ensure all your data has been migrated to newer tables\n"
- . "If you want to continue, run this script again with the --force \n"
+ . "It is recommended to backup your database first, and ensure all your data has\n"
+ . "been migrated to newer tables. If you want to continue, run this script again\n"
+ . "with --force.\n"
);
}
}
private function pageExists( $name, $db ) {
- return $db->selectField( 'page', '1', array( 'page_namespace' => NS_FILE, 'page_title' => $name ), __METHOD__ );
+ return $db->selectField(
+ 'page',
+ '1',
+ array( 'page_namespace' => NS_FILE, 'page_title' => $name ),
+ __METHOD__
+ );
}
private function pokeFile( $orig, $new ) {
parent::__construct();
$this->mDescription = 'Remove cache entries for removed ResourceLoader modules from the database';
$this->addOption( 'batchsize', 'Delete rows in batches of this size. Default: 500', false, true );
- $this->addOption( 'max-slave-lag', 'If the slave lag exceeds this many seconds, wait until it drops below this value. Default: 5', false, true );
+ $this->addOption(
+ 'max-slave-lag',
+ 'If the slave lag exceeds this many seconds, wait until it drops below this value. '
+ . 'Default: 5',
+ false,
+ true
+ );
}
public function execute() {
$this->mDescription = "Cleanup all spam from a given hostname";
$this->addOption( 'all', 'Check all wikis in $wgLocalDatabases' );
$this->addOption( 'delete', 'Delete pages containing only spam instead of blanking them' );
- $this->addArg( 'hostname', 'Hostname that was spamming, single * wildcard in the beginning allowed' );
+ $this->addArg(
+ 'hostname',
+ 'Hostname that was spamming, single * wildcard in the beginning allowed'
+ );
}
public function execute() {
$content = $rev->getContent( Revision::RAW );
$this->output( "reverting\n" );
- $page->doEditContent( $content, wfMessage( 'spam_reverting', $domain )->inContentLanguage()->text(),
- EDIT_UPDATE, $rev->getId() );
+ $page->doEditContent(
+ $content,
+ wfMessage( 'spam_reverting', $domain )->inContentLanguage()->text(),
+ EDIT_UPDATE,
+ $rev->getId()
+ );
} elseif ( $this->hasOption( 'delete' ) ) {
// Didn't find a non-spammy revision, blank the page
$this->output( "deleting\n" );
- $page->doDeleteArticle( wfMessage( 'spam_deleting', $domain )->inContentLanguage()->text() );
+ $page->doDeleteArticle(
+ wfMessage( 'spam_deleting', $domain )->inContentLanguage()->text()
+ );
} else {
// Didn't find a non-spammy revision, blank the page
$handler = ContentHandler::getForTitle( $title );
$content = $handler->makeEmptyContent();
$this->output( "blanking\n" );
- $page->doEditContent( $content, wfMessage( 'spam_blanking', $domain )->inContentLanguage()->text() );
+ $page->doEditContent(
+ $content,
+ wfMessage( 'spam_blanking', $domain )->inContentLanguage()->text()
+ );
}
$dbw->commit( __METHOD__ );
}
$title = Title::newFromText( $verified );
if ( $row->wl_user == 0 || is_null( $title ) || !$title->equals( $current ) ) {
- $this->output( "invalid watch by {$row->wl_user} for ({$row->wl_namespace}, \"{$row->wl_title}\")\n" );
+ $this->output( "invalid watch by {$row->wl_user} for "
+ . "({$row->wl_namespace}, \"{$row->wl_title}\")\n" );
$updated = $this->removeWatch( $row );
$this->progress( $updated );
return;
require_once __DIR__ . '/Maintenance.php';
+// @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $optionsWithArgs;
+// @codingStandardsIgnoreEnd
if ( !isset( $optionsWithArgs ) ) {
$optionsWithArgs = array();
}
class CommandLineInc extends Maintenance {
public function __construct() {
+ // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $optionsWithArgs;
+ // @codingStandardsIgnoreEnd
parent::__construct();
foreach ( $optionsWithArgs as $name ) {
$this->addOption( $name, '', false, true );
}
public function execute() {
+ // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $args, $options;
+ // @codingStandardsIgnoreEnd
$args = $this->mArgs;
$options = $this->mOptions;
}